<%@ Page Title="Core features" Language="C#" MasterPageFile="~/Demo.master" Inherits="DemoPage" %>

<%@ Register Src="~/CodeFormatter.ascx" TagName="Code" TagPrefix="demo" %>
<%--<script runat="server">
    protected void OnAnimateChanged(object sender, EventArgs e)
    {
        SampleSlider.EnabledAnimate = cbEnabledAnimate.Checked;
    }

    protected void OnUpdate(object sender, EventArgs e)
    {
        int min = Convert.ToInt16(txtMinimum.Text);
        int max = Convert.ToInt16(txtMaximum.Text);
        int step = Convert.ToInt16(txtStep.Text);
        int value = Convert.ToInt16(txtValue.Text);
        int value1 = Convert.ToInt16(txtValue1.Text);

        if (min > -1)
            SampleSlider.Minimum = min;
        if (max > 0)
            SampleSlider.Maximum = max;
        if (step > 0)
            SampleSlider.Step = step;
        if (value > -1)
            SampleSlider.Value = value;
        if (value1 > -1)
            SampleSlider.Value1 = value1;
    }

    protected void OnOrientationChange(object sender, EventArgs e)
    {
        SampleSlider.Orientation = (Orientation)Enum.Parse(typeof(Orientation), OrientationDropDown.SelectedValue);
    }

    protected void OnAutoPostBackChecked(object sender, EventArgs e)
    {
        SampleSlider.AutoPostBack = cbAutoPostBack.Checked;
    }

    protected void OnRangeChanged(object sender, EventArgs e)
    {
        SampleSlider.Range = (SliderRanges)Enum.Parse(typeof(SliderRanges), RangeDropDown.SelectedValue);
    }

    protected void SampleSlider_ValueChanged(object sender, EventArgs e)
    {
        Label1.Text = SampleSlider.Value.ToString();
    }
</script>--%>
<asp:Content ID="Content1" ContentPlaceHolderID="DemoHolder" runat="Server">
    <div class="dna-state-help ui-corner-all" style="margin-bottom: 10px;">
        The basic Slider Control is horizontal and has a single handle that can be moved with the
        mouse or by using the arrow keys.
    </div>
    <%--    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>--%>
    <DotNetAge:Slider ID="SampleSlider" runat="server" Orientation="Horizontal" EnabledAnimate="true"
        BoundControlID="TextBox1"></DotNetAge:Slider>
    <br />
    <br />
    <span>Value:</span><asp:TextBox ID="TextBox1" runat="server" Text="0"></asp:TextBox>
    <br />
    <%--<div style="position: relative; display: block; height: 250px;">
        <div style="position: absolute; float: left;"> OnValueChanged="SampleSlider_ValueChanged"
            <h6>
                <b>Client Events:</b></h6>
            <div class="dna-demo-fields">
                <ul>
                    <li><span>event:</span><label id="el"></label></li>
                    <li><span>value:</span><label id="st">0</label></li>
                </ul>
            </div>
        </div>
        <div style="position: absolute; float: left; left: 200px;">
            <h6>
                <b>Properties:</b></h6>
            <div class="dna-demo-fields">
                <ul>
                    <li><span>EnabledAnimate:</span><asp:CheckBox ID="cbEnabledAnimate" runat="server"
                        AutoPostBack="true" OnCheckedChanged="OnAnimateChanged" />
                    </li>
                    <li><span>AutoPostBack</span><asp:CheckBox ID="cbAutoPostBack" runat="server" AutoPostBack="true"
                        OnCheckedChanged="OnAutoPostBackChecked" Checked="false" /></li>
                    <li><span>Orientation</span><asp:DropDownList ID="OrientationDropDown" runat="server"
                        AutoPostBack="true" OnSelectedIndexChanged="OnOrientationChange">
                        <asp:ListItem Text="Horizontal" Selected="true" Value="Horizontal"></asp:ListItem>
                        <asp:ListItem Text="Vertical" Value="Vertical"></asp:ListItem>
                    </asp:DropDownList>
                    </li>
                    <li><span>Ranges</span><asp:DropDownList ID="RangeDropDown" runat="server" AutoPostBack="true"
                        OnSelectedIndexChanged="OnRangeChanged">
                        <asp:ListItem Text="NotSet" Selected="true" Value="NotSet"></asp:ListItem>
                        <asp:ListItem Text="Min" Value="Min"></asp:ListItem>
                        <asp:ListItem Text="Max" Value="Max"></asp:ListItem>
                    </asp:DropDownList>
                    </li>
                    <li><span>Maximum</span>
                        <asp:TextBox ID="txtMaximum" runat="server" Text="0"></asp:TextBox></li>
                    <li><span>Minimum</span>
                        <asp:TextBox ID="txtMinimum" runat="server" Text="0"></asp:TextBox></li>
                    <li><span>Step</span>
                        <asp:TextBox ID="txtStep" runat="server" Text="0"></asp:TextBox></li>
                    <li><span>Value</span>
                        <asp:TextBox ID="txtValue" runat="server" Text="0"></asp:TextBox></li>
                    <li><span>Value1</span>
                        <asp:TextBox ID="txtValue1" runat="server" Text="-1"></asp:TextBox></li>
                    <li>
                        <asp:Button ID="Button1" runat="server" Text="Update" OnClick="OnUpdate" /></li>
                </ul>
            </div>
        </div>

    </div>--%>
    <%--       OnClientSliding="displayClientInfo(event,ui);"
        OnClientStartSliding="displayClientInfo(event,ui);" OnClientStopSliding="displayClientInfo(event,ui);"
        OnClientValueChanged="displayClientInfo(event,ui);" </ContentTemplate>
    </asp:UpdatePanel>
    <div>
    </div>

    <script type="text/javascript">

        function displayClientInfo(event, ui) {
            $('#el').html(event.type);
            if (ui.values) {
                $('#st').html("value:" + ui.values[0] + ",value1:" + ui.values[1]);
            }
            else
                $('#st').html(ui.value);
          }
    </script>
--%>
    <%--<textarea id="TraceConsole" cols="80" rows="50"></textarea>--%>
    <br />
    <demo:Code runat="server" ID="codeView" SourceFile="~/Slider/Codes/CoreSample.aspx" />
</asp:Content>
